package 线程.day4.demo2;

//public class S3 {
//    private static S3 instance;
//	private S3(){
//
//	}
//	public static synchronized S3 getInstance(){
//		if(instance==null){
//			instance=new S3();
//		}
//		return instance;
//	}
//}

public class S3 {
	private static S3 instance;
	private S3(){
	}
	public static S3 getInstance(){
		if(instance==null){
			synchronized (S3.class) {
				if(instance==null){
					instance=new S3();
				}
			}
		}
		return instance;
	}
}